package ut.servlet.member;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
public class UpdateUser extends HttpServlet{
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		request.setCharacterEncoding("utf-8");
		// 重新抓取使用者資料到 Session 中
		ut.data.User user = (ut.data.User)request.getSession().getAttribute("user");
		user = ut.data.User.getUser(user.id);
		if(user == null){
			response.setHeader("result", "false");
		}else{
			request.getSession().setAttribute("user", user);
			response.setHeader("result", "true");
		}
	}
}